-
Notifications
You must be signed in to change notification settings - Fork 30k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
http2: fix subsequent end calls to not throw #15414
Conversation
Calling Http2ServerResponse.end multiple times should never cause the code to throw an error, subsequent calls should instead return false. Fix behaviour to match http1. Fixes: https://github.com/nodejs/node/issues/15385m
9652050
to
8be7991
Compare
Forgot to sprinkle a couple of |
f2677e5
to
8be7991
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@@ -19,6 +19,9 @@ const { | |||
// but may be invoked repeatedly without throwing errors. | |||
const server = createServer(mustCall((request, response) => { | |||
strictEqual(response.closed, false); | |||
response.on('finish', mustCall(() => process.nextTick( | |||
mustCall(() => doesNotThrow(() => response.end('test', mustNotCall()))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit (feel free to ignore): mustCall
seems redundant here. process.nextTick()
callback is always called.
The failure is not related, landing.
|
Landed as a4e923f. |
Calling Http2ServerResponse.end multiple times should never cause the code to throw an error, subsequent calls should instead return false. Fix behaviour to match http1. Fixes: #15385 PR-URL: #15414 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Calling Http2ServerResponse.end multiple times should never cause the code to throw an error, subsequent calls should instead return false. Fix behaviour to match http1. Fixes: #15385 PR-URL: #15414 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Calling Http2ServerResponse.end multiple times should never cause the code to throw an error, subsequent calls should instead return false. Fix behaviour to match http1. Fixes: nodejs/node#15385 PR-URL: nodejs/node#15414 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Calling Http2ServerResponse.end multiple times should never cause the code to throw an error, subsequent calls should instead return false. Fix behaviour to match http1. Fixes: nodejs/node#15385 PR-URL: nodejs/node#15414 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Calling
Http2ServerResponse.end
multiple times should never cause the code to throw an error, subsequent calls should instead return false. This adjusts the behaviour to match http1. Fixes #15385Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passesAffected core subsystem(s)
http2, test